package com.situ.water_BE.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.water_BE.pojo.BeOrderlite;
import com.situ.water_user.util.LiteAndEmp;
import com.situ.water_user.util.LiteTJ;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@Mapper
public interface BeOrderliteMapper extends BaseMapper<BeOrderlite> {
    @Insert("insert into BE_OrderLite(orderType,datee,empId,userNo,userName,description) values(#{orderType},#{datee},#{empId},#{userNo},#{userName},#{description})")
    public void addLite(BeOrderlite lite);


    @Select("<script>" +
            "select o.*,e.EmpNmae from BE_OrderLite o,SY_Emp e " +
            "<where> o.EmpID=e.empNo" +
            "<if test=\"orderType!=null\"> and orderType=#{orderType}</if>" +
            "<if test=\"empId!=null\"> and empId=#{empId}</if>" +
            "<if test=\"minDate!=null and minDate!=''\"> and datee &gt;=#{minDate}</if>" +
            "<if test=\"maxDate!=null and maxDate!=''\"> and datee &lt;=#{maxDate}</if> </where></script>")
    public List<LiteAndEmp> queryPageLite(LiteTJ tj);

}
